import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import { hashHistory, IndexRoute, Route, Router } from 'react-router';
import AsyncComponent from './../../components/Bundle/index.js';
const List = AsyncComponent(() => import('./../../pages/WorkConnect/list/index.js'))
const Card = AsyncComponent(() => import('./../../pages/WorkConnect/card/index.js'))
import App from '../../layout/App';
import './index.less';

const Routers = () => {
  return (
    <Router history={hashHistory}>{/**不用history报错getCurrentLocation undefined */}
      <Route exact path="/" component={App}>
        <IndexRoute component={List} />{/**默认页面，浏览页http://127.0.0.1:3000/WorkConnect.html#/  */}
        <Route path="/list" component={List} />{/**浏览页 http://127.0.0.1:3000/WorkConnect.html#/list/*/}
        <Route path="/card" component={Card} />{/**编辑页 http://127.0.0.1:3000/WorkConnect.html#/card/*/}
      </Route>
    </Router>
  )
}

ReactDOM.render(<Routers />,
  document.querySelector("#app"));